

import { Table } from "antd";
import React from "react";
import axios from "axios";
axios.defaults.timeout = 16000;

class Newkehu extends React.Component {
  constructor(props) {
    super(props);
    this.state = {
      a: [],
      b: [],
      c: [],
      d: [],
      e: [],
      f: [],
      g: [],
      h: [],
      i: [],
      j: [],
      k1: [],
      a12: [],
      a13: [],
      a14: [],
      a15: [],
      a16: [],
      a17: [],
      a1: [],
      a18: [],
      a19: [],
      a20: [],
      a21: [],
      a31: [],
      a22: [],
      a23: [],
      a24: [],
      a25: [],
      a36: [],
      a37: [],
      a38: [],
      a39: [],
      a40: [],
      a26: [],
      
    };
  }

  /* 
  a= 蔡正平= 43.153.65.89
  b= 郭发展=  43.153.79.98
  c = 郭蒋平= 43.135.172.133
  d  = 郭凯鸿6=43.152.217.89
  e=  郭煜尚7= 43.158.210.229
  f= 李瑶瑶2= 43.158.194.253
  g=  潘秀丽1= 43.134.231.239
  h=    彭香兰8=  43.135.155.149
  i= 叶凤华3=43.156.231.195
  j= 沈信义5=119.28.250.113
  k=刘爱绿4=119.28.250.113
  */
  componentDidMount() {
    // 账号1的高度a
    axios
      .get("http://129.226.203.217:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a: "0" });
      });
    //账号2高度b
    axios
      .get("http://129.226.40.38:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          b: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ b: "0" });
      });
    //账号3高度c
    axios
      .get("http://43.153.74.154:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          c: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ c: "0" });
      });
    //账号4高度d
    axios
      .get("http://124.156.0.114:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          d: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ d: "0" });
      });
    //账号5高度e
    axios
      .get("http://43.153.68.26:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          e: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ e: "0" });
      });
    //账号6高度f
    axios
      .get("http://43.153.25.87:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          f: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ f: "0" });
      });
    //账号7高度g
    axios
      .get("http://43.153.64.101:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          g: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ g: "0" });
      });
    //账号8高度h
    axios
      .get("http://43.153.85.90:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          h: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ h: "0" });
      });
    //账号9高度i
    axios
      .get("http://43.135.166.80:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          i: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ i: "0" });
      });
    //账号10高度j
    axios
      .get("http://43.153.32.226:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          j: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ j: "0" });
      });
    //账号11高度k
    axios
      .get("http://43.153.31.243:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          k1: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ k1: "0" });
      });

    //账号12高度a12
    axios
      .get("http://43.128.178.230:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a12: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a12: "0" });
      });
    //账号13高度a13
    axios
      .get("http://124.156.2.144:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a13: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a13: "0" });
      });
    //账号13高度a14
    axios
      .get("http://129.226.30.55:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a14: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a14: "0" });
      });
    //账号13高度a15
    axios
      .get("http://43.128.179.129:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a15: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a15: "0" });
      });
    //账号13高度a16
    axios
      .get("http://43.153.102.209:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a16: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a16: "0" });
      });
    //账号13高度a17
    axios
      .get("http://43.153.120.67:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a17: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a17: "0" });
      });
    //账号13高度a18
    axios
      .get("http://43.153.57.237:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a18: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a18: "0" });
      });
    //账号13高度a19
    axios
      .get("http://43.134.183.71:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a19: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a19: "0" });
      });
    //账号13高度a20
    axios
      .get("http://43.153.209.78:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a20: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a20: "0" });
      });
    //账号13高度a21
    axios
      .get("http://43.153.106.228:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a21: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a21: "0" });
      });
      //账号14高度a22
    axios
    .get("http://43.156.182.8:31401")
    .then((res) => {
      console.log(res.data.core_latest_ledger);
      this.setState({
        a22: res.data.core_latest_ledger,
      });
    })
    .catch((err) => {
      this.setState({ a22: "0" });
    });
    //账号13高度a23
    axios
      .get("http://43.156.133.31:31401")
      .then((res) => {
        console.log(res.data.core_latest_ledger);
        this.setState({
          a23: res.data.core_latest_ledger,
        });
      })
      .catch((err) => {
        this.setState({ a23: "0" });
      });
    // //账号13高度a22
    // axios
    //   .get("http://43.153.35.169:31401")
    //   .then((res) => {
    //     console.log(res.data.core_latest_ledger);
    //     this.setState({
    //       a22: res.data.core_latest_ledger,
    //     });
    //   })
    //   .catch((err) => {
    //     this.setState({ a22: "0" });
    //   });
    // //账号13高度a23
    // axios
    //   .get("http://43.135.166.37:31401")
    //   .then((res) => {
    //     console.log(res.data.core_latest_ledger);
    //     this.setState({
    //       a23: res.data.core_latest_ledger,
    //     });
    //   })
    //   .catch((err) => {
    //     this.setState({ a23: "0" });
    //   });
    //  //账号13高度a24
    //  axios
    //  .get("http://43.156.83.81:31401")
    //  .then((res) => {
    //    console.log(res.data.core_latest_ledger);
    //    this.setState({
    //      a24: res.data.core_latest_ledger,
    //    });
    //  })
    //  .catch((err) => {
    //    this.setState({ a24: "0" });
    //  });
    //   //账号13高度a25
    //   axios
    //   .get("http://43.134.239.233:31401")
    //   .then((res) => {
    //     console.log(res.data.core_latest_ledger);
    //     this.setState({
    //       a25: res.data.core_latest_ledger,
    //     });
    //   })
    //   .catch((err) => {
    //     this.setState({ a25: "0" });
    //   });
    
  }
  render() {
    const dataSource = [
      {
        key: "1",
        name: "陈祥龙",
        address: this.state.a,
        differ: this.state.a - this.state.a,
        todesk: "625063342",
        ip: (
          <a href="http://129.226.203.217:31401" target="_blank">
            129.226.203.217
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "2",
        name: "当当",
        address: this.state.b,
        differ: this.state.a - this.state.b,
        todesk: "440307994",
        ip: (
          <a href="http://129.226.40.38:31401" target="_blank">
           129.226.40.38
          </a>
        ),
        des: <font color="red">云服务器孟买</font>,
      },
      {
        key: "3",
        name: "高敏",
        address: this.state.c,
        differ: this.state.a - this.state.c,
        todesk: "997766516",
        ip: (
          <a href="http://43.153.74.154:31401" target="_blank">
           43.153.74.154
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "4",
        name: "李洪喜1",
        address: this.state.d,
        differ: this.state.a - this.state.d,
        todesk: "415529230",
        ip: (
          <a href="http://124.156.0.114:31401" target="_blank">
          124.156.0.114
          </a>
        ),
        des: <font color="red">云服务器孟买</font>,
      },
      {
        key: "5",
        name: "李淑元",
        address: this.state.e,
        differ: this.state.a - this.state.e,
        todesk: "769663858",
        ip: (
          <a href="http://43.153.68.26:31401" target="_blank">
            43.153.68.26
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "6",
        name: "刘洪波",
        address: this.state.f,
        differ: this.state.a - this.state.f,
        todesk: "591224595",
        ip: (
          <a href="http://43.153.25.87:31401" target="_blank">
            43.153.25.87
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "7",
        name: "马哥",
        address: this.state.g,
        differ: this.state.a - this.state.g,
        todesk: "927929609",
        ip: (
          <a href="http://43.153.64.101:31401" target="_blank">
           43.153.64.101
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "8",
        name: "三燕",
        address: this.state.h,
        differ: this.state.a - this.state.h,
        todesk: "199664559",
        ip: (
          <a href="http://43.153.85.90:31401" target="_blank">
           43.153.85.90
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "9",
        name: "沈阳王哥",
        address: this.state.i,
        differ: this.state.a - this.state.i,
        todesk: "427086322",
        ip: (
          <a href="http://43.135.166.80:31401" target="_blank">
            43.135.166.80
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "10",
        name: "新乡-杜连霞",
        address: this.state.j,
        differ: this.state.a - this.state.j,
        todesk: "929652418",
        ip: (
          <a href="http://43.153.32.226:31401" target="_blank">
            43.153.32.226
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "11",
        name: "新乡-王丽娜",
        address: this.state.k1,
        differ: this.state.a - this.state.k1,
        todesk: "372650016",
        ip: (
          <a href="http://43.153.31.243:31401" target="_blank">
            43.153.31.243
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "12",
        name: "新乡自峰-陈广随",
        address: this.state.a12,
        differ: this.state.a - this.state.a12,
        todesk: "832040238",
        ip: (
          <a href="http://43.128.178.230:31401" target="_blank">
            43.128.178.230
          </a>
        ),
        des: <font color="red">云服务器孟买</font>,
      },
      {
        key: "13",
        name: "新乡自峰-宋雪瑞",
        address: this.state.a13,
        differ: this.state.a - this.state.a13,
        todesk: "431 233 638",
        ip: (
          <a href="http://124.156.2.144:31401" target="_blank">
          124.156.2.144
          </a>
        ),
        des: <font color="red">云服务器孟买</font>,
      },
      {
        key: "14",
        name: "新乡自峰-周湘峰",
        address: this.state.a14,
        differ: this.state.a - this.state.a14,
        todesk: "547 338 181",
        ip: (
          <a href="http://129.226.30.55:31401" target="_blank">
           129.226.30.55
          </a>
        ),
        des: <font color="red">云服务器孟买</font>,
      },
      {
        key: "15",
        name: "吴新乡自峰-周子钰",
        address: this.state.a15,
        differ: this.state.a - this.state.a15,
        todesk: "619 191 723",
        ip: (
          <a href="http://43.128.179.129:31401" target="_blank">
           43.128.179.129
          </a>
        ),
        des: <font color="red">云服务器孟买</font>,
      },
      {
        key: "16",
        name: "延瑜",
        address: this.state.a16,
        differ: this.state.a - this.state.a16,
        todesk: "138 310 290",
        ip: (
          <a href="http://43.153.102.209:31401" target="_blank">
           43.153.102.209
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "17",
        name: "张琳",
        address: this.state.a17,
        differ: this.state.a - this.state.a17,
        todesk: "578 551 360",
        ip: (
          <a href="http://43.153.120.67:31401" target="_blank">
            43.153.120.67
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "18",
        name: "章林星",
        address: this.state.a18,
        differ: this.state.a - this.state.a18,
        todesk: "755 304 961",
        ip: (
          <a href="http://43.153.57.237:31401" target="_blank">
            43.153.57.237
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "19",
        name: "张楠",
        address: this.state.a19,
        differ: this.state.a - this.state.a19,
        todesk: "483 325 907",
        ip: (
          <a href="http://43.134.183.71:31401" target="_blank">
            43.134.183.71
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "20",
        name: "张胜周",
        address: this.state.a20,
        differ: this.state.a - this.state.a20,
        todesk: "884 059 977",
        ip: (
          <a href="http://43.153.209.78:31401" target="_blank">
           43.153.209.78
          </a>
        ),
        des:"云服务器新加坡" ,
      },
      {
        key: "21",
        name: "张勇",
        address: this.state.a21,
        differ: this.state.a - this.state.a21,
        todesk: "909 314 658",
        ip: (
          <a href="http://43.153.106.228:31401" target="_blank">
           43.153.106.228
          </a>
        ),
        des: "云服务器美国",
      },
      {
        key: "22",
        name: "张勇",
        address: this.state.a22,
        differ: this.state.a - this.state.a22,
        todesk: "909 314 658",
        ip: (
          <a href="http://43.156.182.8:31401" target="_blank">
           43.156.182.8
          </a>
        ),
        des: "云服务器新加坡",
      },
      {
        key: "23",
        name: "朱春雨",
        address: this.state.a23,
        differ: this.state.a - this.state.a23,
        todesk: "909 314 658",
        ip: (
          <a href="http://43.156.133.31:31401" target="_blank">
           43.156.133.31
          </a>
        ),
        des: "云服务器新加坡",
      },
      // {
      //   key: "22",
      //   name: "张晓燕",
      //   address: this.state.a22,
      //   differ: this.state.a - this.state.a22,
      //   todesk: "499 068 163",
      //   ip: (
      //     <a href="http://43.153.35.169:31401" target="_blank">
      //       43.153.35.169
      //     </a>
      //   ),
      //   des: "云服务器美国",
      // },
      // {
      //   key: "23",
      //   name: "赵前进",
      //   address: this.state.a23,
      //   differ: this.state.a - this.state.a23,
      //   todesk: "984 869 198",
      //   ip: (
      //     <a href="http://43.135.166.37:31401" target="_blank">
      //       43.135.166.37
      //     </a>
      //   ),
      //   des: "云服务器美国",
      // },
      // {
      //   key: "24",
      //   name: "郑良成",
      //   address: this.state.a24,
      //   differ: this.state.a - this.state.a24,
      //   todesk: "456 826 459",
      //   ip: (
      //     <a href="http://43.156.83.81:31401" target="_blank">
      //       43.156.83.81
      //     </a>
      //   ),
      //   des: "云服务器新加坡",
      // },
      // {
      //   key: "25",
      //   name: "朱守放",
      //   address: this.state.a25,
      //   differ: this.state.a - this.state.a25,
      //   todesk: "752 251 026",
      //   ip: (
      //     <a href="http://43.134.239.233:31401" target="_blank">
      //      43.134.239.233
      //     </a>
      //   ),
      //   des: "云服务器新加坡",
      // },
      
     
      
     
    ];

    const columns = [
      {
        title: "业主名字",
        dataIndex: "name",
        key: "name",
      },
      {
        title: "区块高度",
        dataIndex: "address",
        key: "address",
      },
      {
        title: "区块延迟数值",
        dataIndex: "differ",
        key: "differ",
      },
      {
        title: "todesk",
        dataIndex: "todesk",
        key: "todesk",
      },
      {
        title: "云服务器ip地址",
        dataIndex: "ip",
        key: "ip",
      },
      {
        title: "云服务器地区",
        dataIndex: "des",
        key: "des",
      },
    ];
    return (
      <div>
        <center>
          <font size="18" color="red">
            第二批客户节点区块高度
          </font>
          <Table dataSource={dataSource} columns={columns} />;
        </center>
      </div>
    );
  }
}

export default Newkehu;
